

<template>
  <h3>测试父子传值的几种方法</h3>
  <label for="data1">data1: </label>
  <input type="text" v-model="data1" id="data1"/>
  <hr>
  <label for="data3">data3: </label>
  <input type="text" v-model="data3" id="data3"/>
  <hr>
  <ComA ref="ComARef" :data1="data1" :data2 = "data2" :data3="data3"></ComA>
</template>


<script setup lang="ts">
import { provide, ref } from 'vue';
import ComA from './components/ComA.vue'
let data1 = ref('传值1')
let data2 = ref('传值2')
let data3 = ref('传值3')
let data4 = ref('传值4')
let data5 = ref('传值5')
let data6 = ref('传值6')
const ComARef = ref(null)
console.log(ComARef)
defineExpose({
    data4
  } )


provide('data3',data3)

</script>

<style scoped>

</style>
